<template>
  <el-dialog :title="title" :visible.sync="$parent.openDig" width="60%">
    <el-table :data="rowObj.inspectionPlaceRecordAbnormalList" style="width: 100%">
      <el-table-column prop="faultDescribe" label="故障描述" min-width="280" show-overflow-tooltip>

      </el-table-column>
      <el-table-column prop="faultHandleDescribe" label="异常处理描述" min-width="280" show-overflow-tooltip>
        <template slot-scope="scope">
          <template v-if="title === '记录异常' || scope.row.handleUserId">{{ scope.row.faultDescribe }}</template>
          <template v-else>
            <el-input v-model="scope.row.faultDescribe" placeholder="异常处理描述"></el-input>
          </template>
        </template>
      </el-table-column>
      <el-table-column label="处理人" min-width="130">
        <template slot-scope="scope">
          <template v-if="title === '记录异常' || scope.row.handleUserId">{{ scope.row.handleUser }}</template>
          <template v-else>
            <el-select v-model="scope.row.handleUserId" style="width:100%" placeholder="请选择处理人">
              <el-option v-for="value in userList" :key="value.userId" :label="value.userName"
                :value="value.userId + ''">
              </el-option>
            </el-select>
          </template>
        </template>
      </el-table-column>
      <el-table-column label="处理时间" min-width="160">
        <template slot-scope="scope">
          <template v-if="title === '记录异常' || scope.row.handleUserId">{{ scope.row.handleTime }}</template>
          <template v-else>
            <el-date-picker style="width:100%" v-model="scope.row.handleTime" type="date" placeholder="选择日期"
              format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
            </el-date-picker>
          </template>
        </template>
      </el-table-column>
    </el-table>
    <div slot="footer" align="center">
      <el-button @click="$parent.openDig = false">关 闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { listUser } from "@/api/system/user.js";
export default {
  props: ['title', 'rowObj'],
  data () {
    return {
      userList: []
    }
  },
  mounted () {
    this.init()
  },
  methods: {
    async init () {
      const queryuser = {
        status: '0'//正常
      }
      let { data: user } = await listUser(queryuser)
      this.userList = user
    }
  }
}
</script>

<style>

</style>